import type {PageParam, PageResult} from '@vben/request';
import type {Dayjs} from 'dayjs';

import {requestClient} from '#/api/request';
export namespace PerFamilyInvestmentApi {
  /** 国境外投资信息信息 */
  export interface FamilyInvestment {
    id: number; // 主键ID
    employeeId?: number; // 人员ID，对应 per_employee.id
    relation: string; // 与本人关系（称谓）
    systemPersonId: number; // 系统人员ID，对应 system_person.id
    familyName: string; // 投资人姓名
    cardType: string; // 证件类型
    familyIdcard: string; // 投资人身份证号
    investmentUnit: string; // 投资或入股单位
    countryCity: string; // 投资的国家地区及城市
    investmentMethod: string; // 投资或入股方式
    position: string; // 担任职务
    investmentDetails: string; // 投资情况
    currency: string; // 投资币种
    amountInvested: number; // 出资金额
    amountRmb: number; // 人民币金额
    annualReturn: number; // 年收益
    remark: string; // 备注
    status: number; // 状态（1：有效，0：无效）
  }
}

/** 查询国境外投资信息分页 */
export function getFamilyInvestmentPage(data: PageParam,desensitize: boolean,encrypt: boolean) {
  return requestClient.post<PageResult<PerFamilyInvestmentApi.FamilyInvestment>>('/per/family-investment/page', data,{ desensitize,encrypt });
}

/** 查询国境外投资信息详情 */
export function getFamilyInvestment(id: number) {
  return requestClient.get<PerFamilyInvestmentApi.FamilyInvestment>(`/per/family-investment/get?id=${id}`);
}

/** 新增国境外投资信息 */
export function createFamilyInvestment(data: PerFamilyInvestmentApi.FamilyInvestment) {
  return requestClient.post('/per/family-investment/create', data);
}

/** 修改国境外投资信息 */
export function updateFamilyInvestment(data: PerFamilyInvestmentApi.FamilyInvestment) {
  return requestClient.put('/per/family-investment/update', data);
}

/** 删除国境外投资信息 */
export function deleteFamilyInvestment(id: number) {
  return requestClient.delete(`/per/family-investment/delete?id=${id}`);
}

/** 批量删除国境外投资信息 */
export function deleteFamilyInvestmentList(ids: number[]) {
  return requestClient.delete(`/per/family-investment/delete-list?ids=${ids.join(',')}`)
}

/** 导出国境外投资信息 */
export function exportFamilyInvestment(params: any) {
  return requestClient.download('/per/family-investment/export-excel', { params });
}
